package Model

import "time"

type Paycheck struct {
	itsPayPeriodStartDate time.Time
	itsPayPeriodEndDate   time.Time
	itsGrossPay           float64
	itsNetPay             float64
	itsDeductions         float64
	itsFields             map[string]string
}

func CreatePaycheck(start time.Time, end time.Time) *Paycheck {
	return &Paycheck{itsPayPeriodStartDate: start, itsPayPeriodEndDate: end}
}

func (pc *Paycheck) SetGrossPay(grossPay float64) {
	pc.itsGrossPay = grossPay
}

func (pc *Paycheck) SetDeductions(itsDeductions float64) {
	pc.itsDeductions = itsDeductions
}

func (pc *Paycheck) SetNetPay(netPay float64) {
	pc.itsNetPay = netPay
}

func (pc *Paycheck) SetField(name string, value string) {
	pc.itsFields[name] = value
}

func (pc *Paycheck) GetPayPeriodStartDate() time.Time {
	return pc.itsPayPeriodStartDate
}

func (pc *Paycheck) GetPayPeriodEndDate() time.Time {
	return pc.itsPayPeriodEndDate
}

func (pc *Paycheck) GetGrossPay() float64 {
	return pc.itsGrossPay
}

func (pc *Paycheck) GetNetPay() float64 {
	return pc.itsNetPay
}

func (pc *Paycheck) GetDeductions() float64 {
	return pc.itsDeductions
}

func (pc *Paycheck) GetField(name string) string {
	return pc.itsFields[name]
}
